﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Xww.LCV.Generator;

namespace Xww.LCV {
    public static class ServiceFactory {
        public static ILCSGenerator CreateAbsoluteGenerator() {
            return new Generator.Absolute();
        }

        public static ILCSGenerator CreateRelativeGenerator() {
            return new Generator.ConsecutiveSPLikeGenerator();
        }
        public static ILCSGenerator CreateThresholdRelativeGenerator() {
            //return new Generator.ThresholdRelativeGenerator();
            return new Generator.ThresholdRelativeRegexGenerator();
        }
        public static ILCSGenerator CreateGenerator(MiningType type) {
            ILCSGenerator rst = null;
            switch (type) {
                case MiningType.AbsolutePosition:
                    rst = CreateAbsoluteGenerator();
                    break;
                case MiningType.ConsecutiveSP:
                    rst = CreateRelativeGenerator();
                    break;
                case MiningType.RelativePositionThreshold:
                    rst = CreateThresholdRelativeGenerator();
                    break;
                default:
                    break;
            }
            return rst;
        }

    }
}